import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import {usePathNavigationStore} from "@/stores/pathNavigation.js";
import {useFileListStore} from "@/stores/fileListStore.js";
import httpInstance from "@/api/http.js";


export const useUploadStore = defineStore('uploadStore', () => {
  const show = ref(false)
  function getPath() {
    return useFileListStore().curPath
  }
  const url = computed(() => {return `${httpInstance.defaults.baseURL}/file/upload?absolutePath=${encodeURI(getPath())}`})
  const title = computed(() => {return `上传到：${getPath()}`})
  return {show,title,getPath,url}
})
